<?php session_start();?>
<html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <script src="../js/jquery/jquery.js" type="text/javascript"></script>
    </head>
    <body>
<div id="content">
<?php

require_once '../data/connect.class.php';
$connect = new Connect("localhost","root","","email");
$addrId = $_REQUEST['addrId'];

$sql = 'select * from admin_mail_addr where id='.$addrId;
$resultSet = $connect->Query($sql);

echo $resultSet[0]['name'];
echo "<br/>";
echo $resultSet[0]['mail_addr'];

?>
<p>请填写原因:</p>
<textarea cols="40" rows="5" id="text" name="text"></textarea><br />
<p>请填写验证码:</p>
<input type="text" name="code" id="code" /><br />
<img src="/securimage/securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>"><br />


<div onclick="submitReason(<?php echo $addrId?>)" style="cursor: pointer;">提交</div>
</div>
</body>
<script type="text/javascript">
function submitReason(id) {
    var encodedContent = encodeURIComponent($("#text").val());
    var encodedContent = encodeURIComponent(encodedContent);
	$.ajax({
	   type: "POST",
	   url: "/module/module_unsubscript.php",
	   data: "addrId=" + id + "&encodedContent=" + encodedContent + "&code=" + $("#code").val(),
	   success: function(data){
  		  if (data) {
  			  $('#content').html(data);
  		  }
  
	   }
	});
}
</script>
</html>